$def with (page)

$var title: $page.key

<style type="text/css">
#contentBody li {
    list-style-type:none!important;
    line-height: 1em;
}
.dict {
    margin-bottom: 2px;
}
</style>

$def display(d):
    $if is_thing(d):
        $if d.key:
            $:thingrepr(d)
        $else:
            $:display_dict(d)
    $elif isinstance(d, dict):
        $:display_dict(d)
    $elif isinstance(d, list):
        $:display_list(d)
    $else:
        <span class="tag">$(d or "")</span>

$def display_dict(d):
    <ul class="dict">
    $for k in d:
        <li>
            <span class="title">$k:</span>
            $:display(d[k])
        </li>
    </ul>

$def display_list(d):
    <ol>
    $for v in d:
        <li>$:display(v)</li>
    </ol>

<div id="contentHead">
    $:macros.databarView(page)
    <h1>$page.key</h1>
</div>


<div id="contentBody">
$:display_dict(page)
$:render_template("lib/history", page)
</div>
